package com.gxh.controller.user;

import com.gxh.result.Result;
import com.gxh.service.EmployeeService;
import com.gxh.vo.EmployeeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("UserEmployeeController")
@RequestMapping("/user/employee")
@Api(tags = "用户端员工信息接口")
@Slf4j
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    /**
     * 根据设备id查询员工信息
     * @param id
     * @return
     */
    @GetMapping ("/{id}")
    @ApiOperation("根据设备id查询员工信息")
    public Result<EmployeeVO> getById(@PathVariable Long id){
        EmployeeVO employeeVO = employeeService.getByMachineId(id);
        return Result.success(employeeVO);
    }
}
